import Vue from 'vue'
import VueRouter from 'vue-router'

import routes from "./routes"
// import Login from "../views/Login"
// import Home from "../views/Home"
// import Layout from "../views/Layout"

Vue.use(VueRouter)

// 初始化路由
// const routes = [
//   {
//     path: '/login',
//     name: 'Login',
//     component: Login
//   }
// ]

// 动态路由
/* export const DynamicRoutes = [
  {
    path: '',
    name: 'container',
    component: Layout,
    redirect: 'home',
    meta: {
      requireAuth: true,
      name: '首页'
    },
    children: [
      {
        path: 'home',
        name: 'Home',
        component: Home,
        meta: {
          name: '首页',//匹配规则
        },
      }
    ]
  }
] */




const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
})

export default router
